#pragma once

#include "Bullet.h"

namespace BulletScript
{

	class Battery
	{
		std::vector<Bullet> mBullets;

		std::vector<Bullet> mSpawnedBullets;

		bs::Machine* mMachine;

		static const int BATTERY_SIZE = 512;

		int mCount;

	private:

		void AddSpawnedBullets();

		int UpdateBullets(float frameTime);

	public:

		explicit Battery(bs::Machine* machine);

		bs::UserTypeBase* Battery::EmitAngle(float x, float y, float angle, const float* args);

		bs::UserTypeBase* Battery::EmitTarget(float x, float y, float angle, const float* args);

		void KillBullet(bs::UserTypeBase* object);

		void Update(float frameTime);
	};

}
